﻿namespace Beetle
{
    using System;

    public class StringMessage : IMessage
    {
        public string Value;

        public void Load(BufferReader reader)
        {
            this.Value = reader.ReadString(reader.Count);
        }

        public void Save(BufferWriter writer)
        {
            byte[] bytes = writer.Coding.GetBytes(this.Value);
            writer.Write(bytes, 0, bytes.Length);
        }
    }
}

